<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
		<link rel="stylesheet" type="text/css" href="styles/css/global.css">
<script>
		function jumpToPageFunc(pageNo)
			{
				userForm.action="user.do?method=listUser&pageNo="+pageNo;
				userForm.submit();
			}
		</script>

</head>
<body>
<html:form  method="post" action="user.do?method=listUser">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td class="localTdBg">
					当前位置：	
					
						用户管理 -- 查看用户
					
				</td>
			</tr>
			
		</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		 <td class="listTitle">
ID</td>
		 <td class="listTitle">
用户名</td>
		 <td class="listTitle">
真实姓名</td>
		 <td class="listTitle">
级别</td>
		 <td class="listTitle">
职务</td>
		 <td class="listTitle">
创建日期</td>
		 <td class="listTitle">
编辑</td>
	<tr>
		<c:forEach var="user" items="${userList}">
			<tr>
				<td class="listContext">${user.uid} &nbsp</td>
				<td class="listContext">${user.userName }&nbsp</td>
				<td class="listContext">${user.trueName }&nbsp</td>
				<td class="listContext">
					<c:if test="${user.type == 1}">管理员&nbsp</c:if>
					<c:if test="${user.type == 2}">经  &nbsp&nbsp理&nbsp</c:if>
					<c:if test="${user.type == 3}">职  &nbsp&nbsp员&nbsp</c:if>
				</td>
				<td class="listContext">${user.job }&nbsp</td>
				<!--  <td>${user.createDate }&nbsp</td>-->
				<td class="listContext">&nbsp<my:date value="${user.createDate }"
							pattern="yyyy-MM-dd" /></td>
				<td class="listContext">
				<c:if test="${user.type!=1}">&nbsp
				<a href="user.do?method=showUser&uid=${user.uid }">查看</a>&nbsp&nbsp<a href="user.do?method=preUpdateUser&uid=${user.uid }">修改</a>&nbsp&nbsp<a href="user.do?method=deleteUser&uid=${user.uid }">删除</a>
				</c:if>
				<c:if test="${user.type==1}">&nbsp
				管理员不能操作！
				</c:if>
				</td>
			<tr>
		</c:forEach>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td colspan="2">
					<div align="center">
						共有：
						<span class="fontLight">
							${pageInfo.totalResult}
						</span>
						条记录&nbsp;${pageInfo.currentPage }/${pageInfo.totalPage }页 &nbsp; 当前第
						<span class="fontLight">
							${pageInfo.currentPage}
						</span>
						页&nbsp;&nbsp;
						<c:if test="${pageInfo.totalResult>0}">
						 <a href="user.do?method=listUser&pageNo=1">
						  首页
						</a>
						</c:if>
						&nbsp;
						<c:if test="${pageInfo.currentPage>1}">
						<a href="user.do?method=listUser&pageNo=${pageInfo.currentPage-1}">
							上一页
						</a>
						</c:if>
						<c:if test="${pageInfo.currentPage<pageInfo.totalPage}">
						  <a href="user.do?method=listUser&pageNo=${pageInfo.currentPage+1}">
						&nbsp;下一页&nbsp;
						</a>
						</c:if>
						<c:if test="${pageInfo.currentPage<pageInfo.totalPage}">
						   <a href="user.do?method=listUser&pageNo=${pageInfo.totalPage}">
						   尾页&nbsp;
						   </a>
						</c:if>
						<c:if test="${pageInfo.totalResult>1}">
						&nbsp;跳转到
						<select name="jumpToPage" onchange="javascript:jumpToPageFunc(this.value)">
							<c:forEach var="pageCount" begin="1" end="${pageInfo.totalPage}">
									<c:choose>
										<c:when test="${pageCount==pageInfo.currentPage}"><option selected value=${pageCount}>${pageCount}</option></c:when>
										<c:otherwise><option value=${pageCount}>${pageCount}</option></c:otherwise>
									</c:choose>
							</c:forEach>
						</select>
						页
						</c:if>
					</div>
				</td>
			</tr>
		</table>
</html:form>
</body>
</html>